//
//  FirstViewController.swift
//  Pickers
//
//  Created by 鲁万财 on 15/7/27.
//  Copyright (c) 2015年 鲁万财. All rights reserved.
//

import UIKit

class HHWDatePicker: UIViewController {
    
    @IBOutlet weak var datePicker: UIDatePicker!;

    override func viewDidLoad() {
        super.viewDidLoad();
        // Do any additional setup after loading the view, typically from a nib.
        
        var now = NSDate();
        self.datePicker.setDate(now, animated: false);
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @IBAction func buttonPressed(sender: AnyObject) {
        var selected = self.datePicker.date;
        var message = String(format: "The date you selected is : %@", selected);
        var alert = UIAlertView(title: "Date Selected", message: message, delegate: nil, cancelButtonTitle: "That's so true");
        alert.show();
    }


}

